package com.example.costumview.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.Button;
import android.widget.TextView;

import com.example.costumview.R;

public class ViewAnimActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_view_anim);

        Button btn = findViewById(R.id.btn);

        btn .setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                TextView textview = findViewById(R.id.tv);
                Animation animation = AnimationUtils.loadAnimation(ViewAnimActivity.this, R.anim.scaleanim);
                textview.startAnimation(animation);
            }
        });
    }
}